/**
 * 2018年12月10日下午10:50:43
 * @author 谢进财
 */
package com.baihang.project.ds.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.baihang.framework.controller.BaseController;
import com.baihang.framework.kit.ShiroKit;
import com.baihang.framework.kit.database.RedisKit;
import com.baihang.platform.shiro.User;
import com.baihang.project.ds.model.FangYuanModel;
import com.baihang.project.ds.service.DingDanRedisService;

import redis.clients.jedis.Jedis;

/**
 * 订单
 *
 */
@Controller
@RequestMapping("/dingdan")
public class DingDanController extends BaseController {
	private Jedis jedis = RedisKit.getJedis();
	@Autowired
	//private DingDanService service;
	private DingDanRedisService service;
	@RequestMapping
	private String index(Model model) {
		FangYuanModel fyModel = service.getDingDan();
		User user = ShiroKit.getCurrentUser();
		model.addAttribute("fymodel", fyModel);
		model.addAttribute("user", user);
		model.addAttribute("StartTime", jedis.hmget("systemConfig","StartTime").get(0));
		return "/project/ds/dingdan/index";
	}
	
	@RequestMapping("/indexData")
	private String indexData(Model model) {		
		FangYuanModel fyModel = service.getDingDan();
		User user = ShiroKit.getCurrentUser();
		model.addAttribute("fymodel", fyModel);
		model.addAttribute("user", user);
		model.addAttribute("StartTime", jedis.hmget("systemConfig","StartTime").get(0));
		return "/project/ds/dingdan/indexData";
	}
	@RequestMapping("/ddxq")
	private String ddxq(Model model) {
		FangYuanModel fyModel = service.getDingDan();
		User user = ShiroKit.getCurrentUser();
		model.addAttribute("fymodel", fyModel);
		model.addAttribute("user", user);
		return "/project/ds/dingdan/ddxq";
	}
	
	@RequestMapping("/ddxqData")
	private String ddxqData(Model model) {
		FangYuanModel fyModel = service.getDingDan();
		User user = ShiroKit.getCurrentUser();
		model.addAttribute("fymodel", fyModel);
		model.addAttribute("user", user);
		return "/project/ds/dingdan/ddxqData";
	}
}
